package com.xinxing.learning.boot.h2.controller;

import com.xinxing.learning.boot.h2.entity.FtpSyncLog;
import com.xinxing.learning.boot.h2.service.FtpSyncLogService;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/ftpSyncLog")
public class FtpSyncLogController {
    private final FtpSyncLogService ftpSyncLogService;

    public FtpSyncLogController(FtpSyncLogService ftpSyncLogService) {
        this.ftpSyncLogService = ftpSyncLogService;
    }

    @GetMapping("/selectById/{id}")
    public FtpSyncLog selectById(@PathVariable String id) {
        return ftpSyncLogService.selectById(id);
    }

    @PostMapping("/insert")
    public int insert(@RequestBody FtpSyncLog ftpSyncLog) {
        return ftpSyncLogService.insert(ftpSyncLog);
    }

    @GetMapping("/selectList")
    public List<FtpSyncLog> selectList() {
        return ftpSyncLogService.selectList();
    }
}
